package com.admin.core.mapper;

import com.admin.core.entity.SysMenu;
import com.admin.core.entity.SysRoleMenu;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author sq-lan
 */
@Mapper
public interface RoleMenuMapper extends BaseMapper<SysRoleMenu> {

    /**
     * 按角色id列出菜单
     *
     * @param id id
     * @return {@link List}<{@link SysMenu}>
     */
    List<SysMenu> listMenuByRoleId(int id);

    /**
     * 插入数据
     *
     * @param roleId 角色id
     * @param menus  菜单
     */
    void insertData(@Param("roleId") int roleId, @Param("menus") List<SysMenu> menus);

}
